/**
 * Created by wust on 2019-12-26 17:59:14
 * Copyright © 2019 wust. All rights reserved.
 */
package com.sc.workorder.common.config;

import com.sc.common.util.MyMessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: wust
 * @date: Created in 2019-12-26 17:59:14
 * @description:
 *
 */
@Configuration
public class RestTemplateConfig {
    @Autowired
    private MyMessageConverter myMessageConverter;

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(RestTemplateBuilder builder) {
        return myMessageConverter.restTemplate(builder);
    }
}
